/*
 * Copyright © 2009 Gerald Isaac Schwarz
 * 
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

package base;

import java.awt.Point;

public interface Driver {
	
	/**
	 * Use this to end the turn and pass control to the next player in the game.
	 */
	public void endTurn() throws TurnNotFinishedException;
	
	public void addTurnListener(TurnListener turnListener);
	public void removeTurnListener(TurnListener turnListener);
	
	/**
	 * Perform the specified move.
	 * @param piece The piece to be moved.
	 * @param destination The proposed destination.
	 * @throws MoveNotSupportedException If moving isn't supported by the game.
	 * @throws InvalidMoveException If the move isn't legal.
	 */
	public void move(Piece piece, Point destination) throws InvalidMoveException;
	
	/**
	 * Perform the specified drop.
	 * @param piece The piece to be dropped.
	 * @param destination The proposed destination.
	 * @throws DropNotSupportedException If dropping isn't supported by the game.
	 * @throws InvalidDropException If the drop isn't legal.
	 */
	public void drop(Piece piece, Point destination) throws InvalidDropException;
	
	/**
	 * Perform the specified upgrade.
	 * @param piece The piece to be upgraded.
	 * @param type The proposed upgrade.
	 * @throws UpgradeNotSupportedException If upgrading isn't supported by the game.
	 * @throws InvalidUpgradeException If the upgrade isn't legal.
	 */
	public void upgrade(Piece piece, String type) throws InvalidUpgradeException;
}